package uw10.app.display;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.graphics.Paint.Align;

public class GradientRenderer
{
	private Canvas c;
	
	public GradientRenderer()
	{
		c = new Canvas();
	}
	
	public void renderGradient(Bitmap bmp, float[] positions, int[] colors)
	{
		c.setBitmap(bmp);
		
		Paint p = new Paint();
		p.setShader(new LinearGradient(0, 0, bmp.getWidth(), bmp.getHeight(), colors, positions, Shader.TileMode.CLAMP));
		c.drawRect(new Rect(0, 0, bmp.getWidth(), bmp.getHeight()), p);
	}
}
